<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title></title>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
				$("#btnBack").button({
		            icons: {
		                primary: "ui-icon-arrowreturnthick-1-w"
		            }
				}).click(function(){
					$("#job").val("back");
					$("#saveForm").removeAttr("enctype");
					$("#saveForm").submit();
				});
				$("#btnUpload").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }
				}).click(function(){
					if (validateEmpty()) {
						$("#saveForm").submit();
					}
				});
				$("#btnDownload").button({
		            icons: {
		                primary: "ui-icon-arrowthickstop-1-s"
		            }
				}).click(function(){
					window.location='${pageContext.request.contextPath}/acc6?app=ACC60107&job=downloadTemplate';
				});
			});
		</script>
	</head>
	<body>
		<c:set var="auth" value="${el:getMapValue(menuAuth, 'ACC60107')}"/>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="saveForm" id="saveForm" action="${pageContext.request.contextPath}/acc6" method="post" enctype="multipart/form-data">
		<input type="hidden" name="app" id="app" value="ACC60107"/>
		<input type="hidden" name="job" id="job" value="upload"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC60107}</b></th>
			</tr>
			<tr>
				<td width="20%" class="bold">จังหวัด : </td>
				<td>
					<c:if test="${userInfo.areaLevel =='3'}">
						<c:forEach var="data" items="${userInfo.listUserProvice}">
							${data.provinceName}
							<input type="hidden" name="provinceId" id="provinceId" value="${data.provinceId}">
						</c:forEach>
					</c:if>
					<c:if test="${userInfo.areaLevel=='1' || userInfo.areaLevel=='2'}">
						<select name="provinceId" id="provinceId">
							<option value="">----- เลือก -----</option>
							<c:forEach var="data" items="${userInfo.listUserProvice}">
								<c:if test="${data.provinceId == provinceId}" var="provinceSeleted"/>
								<option value="${data.provinceId}" ${provinceSeleted?'selected':''}>${data.provinceName}</option>
							</c:forEach>
						</select>
						<span class="red" id="$provinceId">*</span>
					</c:if>
				</td>
			</tr>
			<tr>
				<td  class="bold" width="20%">นำเข้าจากไฟล์ : </td>
				<td>
					<input type="file" id="btnFile" name="xlsFile"/>
					<span id="#btnFile" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<button type="button" class="acc67-button" name="btnDownload" id="btnDownload">Download Template</button>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<button type="button" class="acc67-button" name="btnUpload" id="btnUpload">Upload file</button>
					<button type="button" class="acc67-button" name="btnBack" id="btnBack">ย้อนกลับ</button>
				</td>
			</tr>
		</table>
		</form>
	</body>
</html>